import { getChannelApi } from "@/apis/article"
import { useEffect, useState } from "react"


function useChannel() { 
    const [channels, setChannels] = useState([])
    useEffect(() => {
        async function fetchChannels() {
            const res = await getChannelApi()
            setChannels(res.data.channels)
        }
        fetchChannels()
    }, [])

    return {channels}

}

export { useChannel}